package com.gsmdata;

import org.apache.hadoop.io.Writable;
import org.apache.hadoop.io.WritableUtils;
import org.apache.hadoop.mapreduce.InputSplit;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * @author Administrator
 */
public class GsmDataInputSplit extends InputSplit implements Writable {

    private int number;

    public GsmDataInputSplit() {
    }

    public GsmDataInputSplit(int number) {
        this.number = number;
    }

    @Override
    public long getLength() {
        return 0;
    }

    @Override
    public String[] getLocations() {
        return new String[]{};
    }

    public int getNumber() {
        return number;
    }

    public void readFields(DataInput in) throws IOException {
        number = WritableUtils.readVInt(in);
    }

    public void write(DataOutput out) throws IOException {
        WritableUtils.writeVInt(out, number);
    }

}
